home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / os2 / watchdog.zip / WATCHDOG.CMD < prev   
OS/2 REXX Batch file  |  1996-05-24  |  20KB  |  491 lines

  1. /*.............. WatchDog session .................*/
  2. /*    (c) AMM,SFY,Sleepy House 1995,96  v.3.33     */
  3.  
  4. Call rxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
  5. Call SysLoadFuncs
  6.  
  7.   ESC        = '1B'x || "["
  8.   black      = 0
  9.   red        = 1
  10.   green      = 2
  11.   yellow     = 3
  12.   blue       = 4
  13.   magenta    = 5
  14.   cyan       = 6
  15.   white      = 7
  16.   foreground = 30
  17.   background = 40
  18.   normal     = 0
  19.   bold       = 1
  20.  
  21.   screen_normal  = normal||";"||foreground+cyan||";"||background+black
  22.   screen_inverse = normal||";"||foreground+black||";"||background+cyan
  23.   text_normal    = screen_normal
  24.   text_ord       = screen_normal||";"||foreground+white
  25.   text_info      = screen_normal||";"||foreground+7
  26.   text_iv        = screen_normal||";"||foreground+5
  27.   text_wait      = screen_normal||";"||foreground+green
  28.   text_extrn     = screen_normal||";"||bold||";"||foreground+blue
  29.   text_highlight = screen_normal||";"||bold||";"||foreground+yellow
  30.   text_alarm     = screen_normal||";"||bold||";"||foreground+red
  31.  
  32.   screen_normal  = ESC||screen_normal||"m"
  33.   screen_inverse = ESC||screen_inverse||"m"
  34.   text_normal    = ESC||text_normal||"m"
  35.   text_ord       = ESC||text_ord||"m"
  36.   text_info      = ESC||text_info||"m"
  37.   text_iv        = ESC||text_iv||"m"
  38.   text_wait      = ESC||text_wait||"m"
  39.   text_extrn     = ESC||text_extrn||"m"
  40.   text_highlight = ESC||text_highlight||"m"
  41.   text_alarm     = ESC||text_alarm||"m"
  42.  
  43.   cSleep = 60
  44.   cLoop  = 30
  45.  
  46.   MaxLines = 1  /* ºñÑß∞ ¬«½¿τÑßΓó« ½¿¡¿⌐ (¼áßΓÑp ¡Ñ óßτÑΓ) */
  47.  
  48.    state.0 = '?' 
  49.    state.1 = '?' 
  50.    state.2 = '.' 
  51.  
  52.  '@echo off'
  53.  'Mode CO60,40'
  54.  
  55.  Call Charout ,screen_normal
  56.  Say Center(' WatchDog Session   Sleepy House   'Date()' ', 60, '═')
  57.  Say ' '
  58.  
  59. /* ñá½ÑÑ »«½πτáѼ ¡áτá½∞¡δ⌐ pẼÑp ½«úá π ¼áßΓÑpá, ß½Ñ⌐ó«ó ¿ Γ«ßßÑpá */
  60.  
  61.  do i=0 to MaxLines
  62.   Call SysFileTree 'C:\fido\Log\t-mail'||i||'.Log','sss','F'
  63.   if sss.0 = 0 then Age.i = '00'||i
  64.                else Parse Value sss.1 With aaa Age.i bbb ccc ddd
  65.   oldAge.i = 'Now'
  66.  end
  67.  
  68.   oldAge.3 = '?'
  69.  
  70.  Call SysFileTree 'C:\fido\Log\Squish.Log','sss','F'
  71.  if sss.0 = 0 then Age_Sq = '0Sq'
  72.               else Parse Value sss.1 With aaa Age_Sq bbb ccc ddd
  73.  oldAge_Sq = 'Now'
  74.  
  75. Call SysFileDelete 'C:\fido\t-mail\Flags\OutStat.OK'
  76.  
  77. /* µ¿¬½ »« ª¿º¡¿ */
  78.  
  79. Do forever
  80.  
  81.   sHH = Time('H')
  82.   Select
  83. /*
  84.    When sHH=8 then do
  85.                     if FileExist('C:\fido\t-mail\Flags\OutStat.OK')="N"
  86.                        then do
  87.                              Say ' -!!!- Prepare Outbound Statistics ...'
  88.                              say ' '
  89.                              '@cd \fido\Tmp'
  90.                              '@C:\fido\Tools\MisureP C:\fido\Out\ -z -w -d>OutStat.Msg 2>nul'
  91.                              Call LineOut "C:\fido\Tmp\OutStat.Msg",'(*1000)    Free         Total '
  92.                              Parse Value SysDriveInfo('C:') With sDrive sFree sTotal sLabel
  93.                              Call LineOut "C:\fido\Tmp\OutStat.Msg",'Disk 'sdrive ' ' trunc(Format(sFree/1000000),3) '     ' trunc(Format(sTotal/1000000),3)
  94.                              Parse Value SysDriveInfo('d:') With sDrive sFree sTotal sLabel
  95.                              Call LineOut "C:\fido\Tmp\OutStat.Msg",'Disk 'sdrive ' ' trunc(Format(sFree/1000000),3) '     ' trunc(Format(sTotal/1000000),3)
  96.                              Call LineOut "C:\fido\Tmp\OutStat.Msg",'   '
  97.                              Call Charout "C:\fido\Tmp\OutStat.Msg"
  98.                              '@c:\fido\tools\SendMsg $c:\fido\mail\sleepyr OutBound/2,2:5020/333.333 All,2:5020/333 "-sLook:" -m< C:\fido\Tmp\OutStat.Msg >nul'
  99.                              Call SysFileDelete 'OutStat.Msg'
  100.                              Call Charout "C:\fido\t-mail\Flags\OutStat.OK",,1
  101.                              Call Charout "C:\fido\t-mail\Flags\OutStat.OK"
  102.                             end
  103.                        else nop
  104.                    end
  105. */
  106.    When sHH=8 then do
  107.                    if FileExist('C:\fido\t-mail\Flags\BackUp.OK')="N"
  108.                       then do
  109.                             Say ' -!!!- Backup /333 files ...'
  110.                             say ' '
  111.                             '@start "Backup" /b/c C:\fido\bat\sh333.Cmd'
  112.                             Call Charout "C:\fido\t-mail\Flags\Backup.OK",,1
  113.                             Call Charout "C:\fido\t-mail\Flags\Backup.OK"
  114.                             Call SysSleep 15
  115.                            end
  116.                       else nop
  117.                    end
  118.    Otherwise
  119.     Call SysFileDelete 'C:\fido\t-mail\Flags\Backup.OK'
  120. /*    Call SysFileDelete 'C:\fido\t-mail\Flags\OutStat.OK' */
  121.   end
  122.  
  123.   Say text_iv' Log: Master='oldAge.0', Line#1='oldAge.1', Line#2='oldAge.3', Tosser='oldAge_Sq
  124.   Say ' '
  125.  
  126.   Say text_normal'─##┬Time────┬M┬1┬2┬T┬C┬FreeC(K)┬FreeD(K)┬In(K)──┬Out(K)───'
  127.   Say            '   │        │ │ │ │ │ │        │        │       │'            
  128.  
  129.   Do jj=1 To cLoop
  130.  
  131.  /*»« commonstste=X πñá½∩εΓ∩ óßÑ bsy */
  132.  
  133.    Select
  134.     when CommonState=='·' then CommonState='∙'
  135.     when CommonState=='∙' then CommonState='÷'
  136.     when CommonState=='÷' then CommonState=''
  137.     when CommonState=='' then CommonState=''
  138.     when CommonState=='' then CommonState=''
  139.     when CommonState=='' then CommonState='■'
  140.     when CommonState=='■' then CommonState='≡'
  141.     when CommonState=='≡' then CommonState=''
  142.     when CommonState=='' then CommonState=''
  143.     when CommonState=='' then CommonState=''
  144.     when CommonState=='' then CommonState=''
  145.     when CommonState=='' then CommonState=''
  146.     when CommonState=='' then CommonState=''
  147.     when CommonState=='' then CommonState=''
  148.     when CommonState=='' then CommonState=''
  149.     when CommonState=='' then CommonState='X'
  150.     Otherwise CommonState='·'
  151.    end
  152.   
  153. /*ºñÑßΓ∞ τ¿ßΓ« ñ½∩ φßΓÑΓ¿¬¿ ¿ ¿¡Σ«p¼áΓ¿ó¡«ß¿ óδ∩ß¡∩ε ÑßΓ∞ ½¿ ¼áßΓÑp*/
  154.  
  155.   if FileExist('C:\fido\t-mail\t-crash$.$00')='Y' 
  156.                   then state.0=text_ord'·'
  157.                   else state.0=text_alarm'?'
  158.                       
  159. /*ß½Ñ⌐óδ*/
  160.  
  161.    Do kk=1 to MaxLines
  162.     if FileExist('C:\fido\t-mail\t-crash$.$0'||kk)='Y'
  163.      then do
  164.            if FileExist('C:\fido\t-mail\flags\busy.00'||kk)='Y'
  165.               then do
  166.                     Call SysSleep 5
  167.  
  168. /* »«ß¬«½∞¬π π ¼Ñ¡∩ ß½Ñ⌐ó «ñ¿¡ Γ« ¼¡Ñ í佫 ½Ñ¡∞ »ÑpÑñѽδóáΓ∞
  169.    su 2 dcd  ñó«⌐¬á «º¡áτáÑΓ óΓ«p«⌐ »«pΓ */
  170.  
  171.                     'C:\os2\SIO\su.exe 2 DCD >nul'
  172.                     if rc == 0 then do
  173.                                      call SysSleep 5
  174.                                      if FileExist('C:\fido\t-mail\Flags\busy.00'||kk)='Y'
  175.                                       then do
  176.                                             Call KillLine(kk)
  177.                                             Call EraseBsy('S')
  178.                                             state.kk = text_alarm'K'
  179.                                             end
  180.                                       else state.kk = text_ord'·'
  181.                                     end
  182.                                else do
  183.                                      state.kk = text_highlight'C'
  184.                                      CommonState=' '
  185.                                     end
  186.                    end
  187.  
  188. /* π ¼Ñ¡∩ ÑΘÑ bbs */
  189.  
  190.               else
  191.                if FileExist('C:\ra\rabusy'.||kk)='Y'
  192.                 then 
  193.                     do
  194.                     state.kk = text_extrn'B'
  195.                     Call SysSleep 5
  196.                     'C:\os2\SIO\su.exe 2 DCD >nul'
  197.                     if rc == 0 then do
  198.                                      call SysSleep 5
  199.                                      if FileExist('C:\ra\rabusy'.||kk)='Y'
  200.                                       then do
  201.                                             '@go -k BBS.BAT >nul'
  202.                                             state.kk = text_alarm'B'
  203.                                             end
  204.                     
  205.                                     end
  206.                     end
  207.                 else
  208.                  if FileExist('C:\fido\t-mail\Flags\voice.00'||kk)='Y'
  209.